﻿using OnlineAuction.DataAccess;
using OnlineAuction.Entity;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace OnlineAuction.Business
{
    public class AuctionStateBO
    {
        public List<AuctionStateDTO> GetAuctionState()
        {
            //Get all category
            List<AuctionStateDTO> list = new List<AuctionStateDTO>();
            AuctionStateDA da = new AuctionStateDA();
            DataSet ds = da.GetAuctionStates();
            list.Add(new AuctionStateDTO(0, ""));
            //Convert dataset to list category
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                list.Add(new AuctionStateDTO(int.Parse(row["AuctionStateID"].ToString()), row["AuctionStateName"].ToString()));
            }
            return list;
        }
    }
}
